﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using DnaCoreLib;

namespace DnaServiceLib
{
    public class TaskManager
    {


        public List<ITaskWorker> TaskList { get { return _taskList; } }

        public List<ITaskWorker> _taskList=new List<ITaskWorker>();

        public int MaxThreadCount { get; set; }

        public int StartedThreads { 
            get 
            {
                return _taskList.Where(w => w.WorkStatus.PercentComplete > 0 && w.WorkStatus.PercentComplete < 100).Count();
            } 
        }
        public TaskManager()
        {
            _taskList = new List<ITaskWorker>();
        }

        public void AddTask(ITaskWorker worker)
        {
            _taskList.Add(worker);
        }


    }
}
